<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: csnf
  Date: 2024/12/23
  Time: 17:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>编辑学生信息</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100vh;
            background-color: #f4f4f4;
        }
        .container {
            width: 100%;
            max-width: 600px;
            text-align: center;
            background-color: #fff;
            padding: 20px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            border-radius: 8px;
        }
        h2 {
            margin-bottom: 20px;
        }
        form {
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        input[type="text"], input[type="date"] {
            padding: 8px;
            width: 100%;
            max-width: 300px;
            margin-bottom: 10px;
            border: 1px solid #ccc;
            border-radius: 4px;
        }
        label {
            margin-bottom: 10px;
            text-align: left;
            width: 100%;
            max-width: 300px;
        }
        input[type="radio"] {
            margin-right: 5px;
        }
        input[type="submit"] {
            padding: 8px 16px;
            background-color: #4CAF50;
            color: white;
            border: none;
            cursor: pointer;
            border-radius: 4px;
            transition: background-color 0.3s;
        }
        input[type="submit"]:hover {
            background-color: #45a049;
        }
        .error-message {
            color: red;
            margin-top: 10px;
        }
    </style>
</head>
<body>
<div class="container">
    <h2>编辑学生信息</h2>
    <form action="StudentServlet" method="post">
        <input type="hidden" name="sId" value="${stu.sId}"><br>
        <input type="text" name="sName" value="${stu.sName}" placeholder="学生姓名" required><br>
        <input type="date" name="birth" value="${stu.birth}" required><br>
        <label>
            <input type="radio" name="gender" value="男" ${stu.gender=='男'?'checked':''}>男
            <input type="radio" name="gender" value="女" ${stu.gender=='女'?'checked':''}>女
        </label><br>
        <select name="cId">
            <option value="${stu.clazzId}">${stu.clazz.cName}</option>
            <c:forEach items="${clazzList}" var="clazz">
            <option value="${clazz.cId}">${clazz.cName}</option>
            </c:forEach>
        </select>
        <input type="submit" value="提交">
    </form>
</div>
</body>
</html>

